﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using KeRui.Common;
using System.Collections.Generic;

public partial class Manage_Database_Backup : System.Web.UI.Page
{
    public List<KeRui.Model.AdminLog> list;
    public string DatabaseBackupPath = PageRequest.GetString("DatabaseBackupPath");

    protected void Page_Load(object sender, EventArgs e)
    {
        ManageHelper.CheckAdminLogin();
        ManageHelper.CheckAdminPower("system_databasebackup");

        if (ManageHelper.PageAct() == "bak")
        {
            WebConfig.SetString("DatabaseBackupPath",DatabaseBackupPath);

            KeRui.BLL.Common db = new KeRui.BLL.Common();
            string bakfile= db.DatabaseBackup(DatabaseBackupPath);

            ManageHelper.AddLog("system_databasebackup", "数据库备份成功，路径：" + bakfile);
            Response.Redirect("backup.aspx?sucmsg=数据库备份成功。");
        }

        KeRui.BLL.AdminLog bll = new KeRui.BLL.AdminLog();
        list = bll.GetList(-1, -1, "system_databasebackup", 0, -1, "", "");
    }
}
